package com.dsl.dslallinone.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import javax.validation.constraints.NotNull;
import java.time.LocalDate;

/**
 * 时间窗口
 */
@Schema(description = "时间窗口")
public class TimeWindow {
    @Schema(description = "开始时间", required = true, example = "2025-08-01")
    @NotNull(message = "开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate start;

    @Schema(description = "结束时间", required = true, example = "2025-08-31")
    @NotNull(message = "结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate end;

    public TimeWindow() {}

    public TimeWindow(LocalDate start, LocalDate end) {
        this.start = start;
        this.end = end;
    }

    // Getters and Setters
    public LocalDate getStart() { return start; }
    public void setStart(LocalDate start) { this.start = start; }
    public LocalDate getEnd() { return end; }
    public void setEnd(LocalDate end) { this.end = end; }
}
